<template>
	<view>
		<view align="center" style="height: 50px;margin-top: 15px;">
			答题者:{{userForm.username}}
			<br>
			得分:{{totalScore}}
			诊断结果:{{scoreCriteria}}
		</view>
		<uni-table border stripe emptyText="暂无更多数据">
			<uni-tr>
				<uni-th align="center" width="100">题目</uni-th>
				<uni-th align="center" width="130">选项(A:完全不会 B:好几天 C:一半以上天数 D:几乎每天)</uni-th>
			</uni-tr>
			<uni-tr v-for="(item,index) in examDetailTable" :key="index">
				<uni-td align="center">{{item.question.questionContent}}</uni-td>
				<uni-td align="center">{{item.optionItem}}</uni-td>
			</uni-tr>
		</uni-table>
		<view>
			
		</view>
	</view>
</template>

<script>
	import {
		uniTable,
		uniTr,
		uniTh,
		uniTd
	} from '@dcloudio/uni-ui'
	export default {
		data() {
			return {
				examDetailTable: [],
				optionItem: {
					A: '完全不会',
					B: '好几天',
					C: '一半以上天数',
					D: '几乎每天'
				},

				scoreCriteria: '',
				totalScore: '',
				userForm: {}
			}
		},
		mounted() {
			this.getdata()
		},
		methods: {
			async getdata() {
				let res = await this.$axios.get(`/api/result/get/3`)
				if (res.code === 200) {
					this.examDetailTable = res.data.combinations
					this.userForm = res.data.user
					this.scoreCriteria = res.data.scoreCriteria
					this.totalScore = res.data.totalScore
				}
				console.log(res.data)
				// console.log(this.userForm)
			}
		},
		components: {
			uniTable,
			uniTr,
			uniTh,
			uniTd
		},
	}
</script>

<style>

</style>
